﻿<UserControl x:Class="VehicleRental.WpfClient.Views.LoginRegisterFormView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:viewModels="clr-namespace:VehicleRental.WpfClient.ViewModels"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.Resources>
            <Style TargetType="TextBox">
                <Setter Property="Width" Value="100" />
                <Setter Property="Height" Value="20" />
            </Style>
            <Style TargetType="TextBlock">
                <Setter Property="Width" Value="100" />
                <Setter Property="Height" Value="20" />
            </Style>
            <Style TargetType="PasswordBox">
                <Setter Property="Width" Value="100" />
                <Setter Property="Height" Value="20" />
            </Style>
        </Grid.Resources>
        <TextBlock Grid.Row="0" 
                   HorizontalAlignment="Right"
                   Grid.Column="0">Username</TextBlock>
        <TextBox Grid.Row="0"
                 HorizontalAlignment="Left"
                 Grid.Column="1"
                 Text="{Binding Username}"/>

        <TextBlock Grid.Row="1" 
                   HorizontalAlignment="Right"
                   Grid.Column="0">Email</TextBlock>

        <TextBox Grid.Row="1"
                 Grid.Column="1"
                 HorizontalAlignment="Left"
                 Text="{Binding Email}"/>

        <TextBlock Grid.Row="2" 
                   HorizontalAlignment="Right"
                   Grid.Column="0">Password</TextBlock>
        <PasswordBox Name="BoxPassword"
                     Grid.Row="2"
                     Grid.Column="1"
                     HorizontalAlignment="Left"/>

        <Button Grid.Row="3"
                Grid.Column="0"
                Content="Login"
                Command="{Binding Login}"
                CommandParameter="{Binding ElementName=BoxPassword}"/>

        <Button Grid.Row="3"
                Grid.Column="1"
                Content="Register"
                Command="{Binding Register}"
                CommandParameter="{Binding ElementName=BoxPassword}"/>
        <TextBlock Text="{Binding Message}"
                   Grid.Row="4"
                   Grid.Column="0"
                   Grid.ColumnSpan="2"/>
    </Grid>
</UserControl>
